<?php

namespace App\Models;

use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

    /**
     * Undocumented class
     * @ name:zf
     */
class User extends Model
{
    use HasFactory;
    use SoftDeletes;

    protected $table = 'zfm_users';
    protected $guarded = [];

    /**
     * '用户关联角色
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function userRole()
    {
        return $this->belongsTo(Role::class, 'role_id', 'id');
    }

    /**
     * Undocumented function
     * 后台用户列表
     * @return void
     */
    public static function adminList($where, $paginate)
    {
        return self::where($where)->paginate($paginate);
    }

    /**
     * Undocumented function
     * 后台用户详情
     * @return void
     */
    public static function adminDetail($where)
    {
        return self::where($where)->first();
    }

    /**
     * Undocumented function
     * 后台用户删除
     * @return void
     */
    public static function adminDel($where)
    {
        return self::where($where)->delete();
    }

}
